import Vue from 'vue'
import App from './App.vue'
import router from './router'
import service from '@/service'
import store from './store'
import './element-ui/element'
import 'font-awesome/css/font-awesome.min.css'
Vue.config.productionTip = false
Vue.prototype.service=service//挂载到原型，全局可用

router.beforeEach((to, from, next) => {
  if(!localStorage.getItem('Authorization')){
    if(to.path!=='/login'){
      next('/login')
    }else next()
  }next()
})

new Vue({
  router,
  store,
  render: h => h(App),
}).$mount('#app')
